package at.fhv.wordProcessing.filter;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import at.fhv.framework.filter.PassivePullFilter;

/**
 * @author Michael
 * @version 1.0
 * @created 16-Nov-2011 10:05:24
 */
public class SourceFilter extends PassivePullFilter<Character, Character> {
	private InputStreamReader _reader;

	public SourceFilter(InputStream input) {
		super(null);
		_reader = new InputStreamReader(input);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Character read() {
		try {
			return (char) _reader.read();
		} catch (IOException e) {
			// Handle exception here
			return null;
		}
	}

	/*
	 * {@inheritDoc}
	 */
	@Override
	public boolean execute(Character entity, Character data) {
		// TODO Auto-generated method stub
		return false;
	}

	/*
	 * {@inheritDoc}
	 */
	@Override
	public Character createEntity() {
		// TODO Auto-generated method stub
		return null;
	}

}